Skip to content

Snapshot#49

Merged
linglingye001 merged 1 commit intorelease/v1.3.0from
linglingye/snapshot
Sep 23, 2025
Merged

Snapshot#49
linglingye001 merged 1 commit intorelease/v1.3.0from
linglingye/snapshot

Conversation

@linglingye001
Copy link
Member

No description provided.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds snapshot support to Azure App Configuration, allowing users to reference immutable snapshots of configuration data instead of using key/label filters. The implementation includes validation to ensure snapshots cannot be used with filters, proper API calls to retrieve snapshot data, and comprehensive test coverage.

  • Adds SnapshotName field to Selector struct for referencing snapshots
  • Implements validation logic to prevent mixing snapshots with key/label filters
  • Adds snapshot retrieval logic using Azure SDK's snapshot APIs

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 16 comments.

Show a summary per file
File Description
azureappconfiguration/options.go Adds SnapshotName field to Selector struct with documentation
azureappconfiguration/utils.go Updates selector validation to handle snapshot selectors and enforce mutual exclusivity with filters
azureappconfiguration/utils_test.go Adds comprehensive test cases for snapshot selector validation scenarios
azureappconfiguration/settings_client.go Implements snapshot retrieval logic using Azure SDK APIs
azureappconfiguration/azureappconfiguration.go Updates feature flag loading to filter non-feature flag content and handle snapshots
azureappconfiguration/snapshot_test.go Comprehensive test suite covering snapshot loading scenarios and mixed content handling

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +92 to +93
if snapshot.CompositionType == nil || *snapshot.CompositionType != azappconfig.CompositionTypeKey {
return nil, fmt.Errorf("composition type for the selected snapshot '%s' must be 'key'", filter.SnapshotName)
Copy link

Copilot AI Aug 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error message should specify what composition types are supported or provide more context about why only 'key' type is allowed.

Suggested change
if snapshot.CompositionType == nil || *snapshot.CompositionType != azappconfig.CompositionTypeKey {
return nil, fmt.Errorf("composition type for the selected snapshot '%s' must be 'key'", filter.SnapshotName)
return nil, fmt.Errorf(
"unsupported composition type '%v' for snapshot '%s': only 'key' is supported by this client. "+
"Other composition types (e.g., 'set') are not supported.",
snapshot.CompositionType, filter.SnapshotName)

Copilot uses AI. Check for mistakes.
@RichardChen820
Copy link
Member

LGTM

@linglingye001 linglingye001 merged commit 2198acc into release/v1.3.0 Sep 23, 2025
13 checks passed
@linglingye001 linglingye001 deleted the linglingye/snapshot branch September 23, 2025 05:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants